-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn user and keep executing if Event Log Service is stopped #442
Conversation
cc @baude this is related to containers/podman#21426 |
The test failures should be fixed by fe7285a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
The handling of the debug flag is done in `setupLogging' after opening the event log, I don't know if this should be done unconditionally even if we could not open the event log, or if we keep the code as it currently is.
cmd/win-sshproxy/main.go
Outdated
log, err := setupLogging(args[0]) | ||
if err != nil { | ||
os.Exit(1) | ||
if sysErr, isSysErr := err.(syscall.Errno); isSysErr && sysErr == RPC_S_SERVER_UNAVAILABLE { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this use https://pkg.go.dev/errors#Is to make this code simpler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated 👍
The fact is that if the event log service is disabled no logs will be written either if there is the debug flag or not. So i don't think it makes any difference. |
As reported by containers/podman#21426 , it may happen that during a Windows update the Event Log Service is disabled automatically without the user noticing it. In this case win-sshproxy fails at starting bc it is not able to write logs. However, the Event Log Service could also be disabled voluntarely by the user and we cannot be sure that the user want/can re-enable it. In such a case, a warn log is printed and win-sshproxy keeps executing. It should be up to the user to decide if to start the Event Log service again or keep running win-sshproxy without logs. Signed-off-by: lstocchi <[email protected]>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfergeau, lstocchi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5f09250
into
containers:main
As reported by containers/podman#21426 , it may happen that during a Windows update the Event Log Service is disabled automatically without the user noticing it. In this case win-sshproxy fails at starting bc it is not able to write logs.
However, the Event Log Service could also be disabled voluntarely by the user and we cannot be sure that the user want/can re-enable it.
With this patch, when the Event Log Service is not running, a warn log is printed and win-sshproxy keeps executing.
It should be up to the user to decide if to start the Event Log service again or keep running win-sshproxy without logs.